#ifndef SYM4SQRNETWORKCONN_H
#define SYM4SQRNETWORKCONN_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QUrl>
#include <QXmlStreamReader>

class Sym4sqrNetworkConn : public QObject
{
    Q_OBJECT
public:
    explicit Sym4sqrNetworkConn(QObject *parent = 0);

private:
    QNetworkAccessManager qnam;
    bool isLoggedIn;
    QString username, password;
    QXmlStreamReader xml;
    QString currentTag;
    QString linkString;
    QString titleString;

    void parseXMLLogin();

signals:
    void loginStatusChanged(bool loginStatus);

public slots:
    void login(QString username, QString password);
    void sendNetworkRequest(QUrl url);
    void networkReplyCallback();
    void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
};

#endif // SYM4SQRNETWORKCONN_H
